home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Toolbox
/
Visual Basic Toolbox (P.I.E.)(1996).ISO
/
graphics
/
frxtract
/
frxdir.frm
next >
Wrap
Text File
|
1995-11-15
|
4KB
|
172 lines
VERSION 2.00
Begin Form frmDirectory
BackColor = &H00C0C0C0&
BorderStyle = 3 'Fixed Double
Caption = "Select A Directory"
ClientHeight = 3885
ClientLeft = 1785
ClientTop = 3060
ClientWidth = 2880
ClipControls = 0 'False
FontBold = 0 'False
FontItalic = 0 'False
FontName = "Courier"
FontSize = 9.75
FontStrikethru = 0 'False
FontTransparent = 0 'False
FontUnderline = 0 'False
ForeColor = &H00000000&
Height = 4290
Icon = 0
Left = 1725
LinkMode = 1 'Source
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 259
ScaleMode = 3 'Pixel
ScaleWidth = 192
Tag = "IconWrks Viewer"
Top = 2715
Width = 3000
Begin CommandButton cmdClose
Caption = "&Close"
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 375
Left = 1110
TabIndex = 5
Top = 3390
Width = 1665
End
Begin Frame fraPath
BackColor = &H00C0C0C0&
Height = 3255
Left = 60
TabIndex = 0
Top = 30
Width = 2715
Begin DirListBox dirList
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 2055
Left = 120
TabIndex = 1
Top = 510
Width = 2505
End
Begin DriveListBox drvList
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Left = 120
TabIndex = 2
Top = 2820
Width = 2505
End
Begin Label zlblDirs
BackStyle = 0 'Transparent
Caption = "&Directories:"
Height = 210
Left = 120
TabIndex = 3
Top = 240
Width = 1365
End
Begin Label zlblDrives
BackStyle = 0 'Transparent
Caption = "Dri&ves:"
Height = 210
Left = 120
TabIndex = 4
Top = 2580
Width = 1365
End
End
End
Option Explicit
Sub cmdClose_Click ()
' unload form
Unload Me
End Sub
Sub dirList_Change ()
' change to selected directory
ChDir dirList.Path
End Sub
Sub dirList_KeyPress (KeyAscii As Integer)
' change path with enter
If KeyAscii = 13 Then
dirList.Path = dirList.List(dirList.ListIndex)
End If
End Sub
Sub drvList_Change ()
' Description:
' Check if drive is ready
' Variables
Dim s1 As String
' handle errors
On Error Resume Next
Err = False
' make error happen
s1 = Dir$(Left$(drvList.Drive, 2))
' if drive was not ready
If Err Then
MsgBox Error, MB_ICONSTOP
drvList.Drive = Left$(dirList.Path, 2)
' if OK
Else
ChDrive drvList.Drive
dirList.Path = CurDir$
End If
End Sub
Sub Form_Unload (Cancel As Integer)
' Variables:
Dim n1 As Integer
Dim s1 As String
' see if selected path already in combo box
s1 = UCase$(dirList.Path)
For n1 = 0 To frmExtract!cboOther.ListCount - 1
If s1 = frmExtract!cboOther.List(n1) Then
frmExtract!cboOther.ListIndex = n1
Exit Sub
End If
Next n1
' add item and set to that item
frmExtract!cboOther.AddItem s1, 0
frmExtract!cboOther.ListIndex = 0
End Sub